import { METHOD, request } from '@/utils/request'
import {
  BANNER_LIST,
  BANNER_EDIT,
  BANNER_DEL,
  MESSAGE_LIST,
  MESSAGE_USER_LIST,
  MESSAGE_UPDATE,
  NEWS_LIST,
  NEWS_EDIT,
  NEWS_DEL,
  USER_LIST,
  USER_EDIT,
  USER_DEL,
  DICT_LIST,
  BASE_UPLOAD
} from './api'

// banner列表
export async function bannerList(params) {
  return request(BANNER_LIST, METHOD.POST, params)
}
// 新增/编辑banner
export async function addOrEditBanner(params) {
  return request(BANNER_EDIT, METHOD.POST, params)
}
// 删除banner
export async function delBanner(params) {
  return request(BANNER_DEL, METHOD.POST, params)
}

// 获取载体信息列表
export async function messageList(params) {
  return request(MESSAGE_LIST, METHOD.POST, params)
}
// 获取招商信息接受人数
export async function messageUserList(params) {
  return request(MESSAGE_USER_LIST, METHOD.POST, params)
}

// 删除载体信息
export async function updateMessage(params) {
  return request(MESSAGE_UPDATE, METHOD.POST, params)
}

// 获取政策指南列表
export async function newsList(params) {
  return request(NEWS_LIST, METHOD.POST, params)
}

// 新建政策指南
export async function addOrEditNews(params) {
  return request(NEWS_EDIT, METHOD.POST, params)
}

// 删除政策指南
export async function delNews(params) {
  return request(NEWS_DEL, METHOD.POST, params)
}

// 获取用户列表
export async function userList(params) {
  return request(USER_LIST, METHOD.POST, params)
}

// 新增/编辑用户
export async function addOrEditUser(params) {
  return request(USER_EDIT, METHOD.POST, params)
}

// 删除用户
export async function delUser(params) {
  return request(USER_DEL, METHOD.POST, params)
}

// 获取地区字典列表
export async function dictList(params) {
  return request(DICT_LIST, METHOD.POST, params)
}

// 上传
export async function baseUpload(params) {
  return request(BASE_UPLOAD, METHOD.POST, params)
}
export default {
  bannerList,
  addOrEditBanner,
  delBanner,
  messageList,
  messageUserList,
  updateMessage,
  newsList,
  addOrEditNews,
  delNews,
  userList,
  addOrEditUser,
  delUser,
  dictList,
  baseUpload
}
